<?php
namespace frontend\assets\popup;
class Popup extends \yii\base\Widget{
	public function run(){
		PopupAsset::register($this->view, ['position'=>$this->view::POS_END]);
		$js = "
		POPUP.initOptions({shadeClose:true});
		$(document).on('click', '[data-filter=\'open\']', function(){
			var url = $(this).data('url');
			$.get(url, function(data){
				POPUP.close();
				POPUP.open({content:data});
			});
		});
		";
		$this->view->registerJs($js, $this->view::POS_END);
	}
}